<template>
	<view class="content">
		<customSwiper :list="swiperList" @change="onSwiperChange" @click="onSwiperClick"></customSwiper>
	</view>
</template>

<script>
	import customSwiper from '@/components/customSwiper.vue'
	export default {
		components: {
			customSwiper
		},
		data() {
			return {
				swiperList: [
					{ image: 'https://placehold.jp/3d4070/ffffff/300x300.png?text=1' },
					{ image: 'https://placehold.jp/ff4400/ffffff/300x300.png?text=2' },
					{ image: 'https://placehold.jp/30a030/ffffff/300x300.png?text=3' },
					{ image: 'https://placehold.jp/ffaa00/ffffff/300x300.png?text=4' },
					{ image: 'https://placehold.jp/aa30aa/ffffff/300x300.png?text=5' }
				]
			}
		},
		onLoad() {
			// 页面加载时的逻辑
		},
		methods: {
			// 轮播图切换事件
			onSwiperChange(index) {
				console.log('轮播图切换到:', index);
			},
			// 轮播图点击事件
			onSwiperClick(index) {
				console.log('点击了轮播图:', index);
				uni.showToast({
					title: `点击了第${index + 1}张图片`,
					icon: 'none'
				});
			}
		}
	}
</script>

<style>
	.content {
		width: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}
</style>
